home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
serial
/
callback.001
/
callback~
/
callback
/
lib
/
ttyline
/
lookuptty.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-22
|
602b
|
28 lines
#include "ttyline.p"
int lookup_tty(char *line)
{
int
index;
char
buffer[10];
if (!line)
return (-1);
if (isdigit(*line)) /* digit requested */
{
sprintf(buffer, "ttyS%s", line); /* make it a ttyS line */
line = buffer;
}
for (index = n_lines; index--; ) /* walk all lines */
{
if (!strcmp(ttyline[index], line)) /* match found ? */
break; /* then break the loop */
}
return (index); /* return the index */
}